/** 轮播图功能模块 */
export const bannerModuleMixin = {
	data() { return { bannerData: [], bannerLoading: true } },
	onLoad() { this.getbannerFn(); },
	methods: {
		async getbannerFn() {
			this.bannerLoading = true;
			try {
				const res = await this.$post('63a5821ddfe77', {
					operationadstype_id: 2
				});
				this.bannerData = res.data || [];
			} catch (e) {}
			this.bannerLoading = false;
		},
		/** 轮播图跳转 */
		bannerNav(info = {}) {
			console.log(info, "info__", info.link_type);
			// 无链接直接退出
			if (info.link_type == 1) {
				// 课程
				if (info.data_type == 1) {
					// uni.navigateTo({ url: "/pages/grzx/productDetails/productDetails?id=" + info.href })
				}
				// 商品
				else uni.navigateTo({ url: "/pages/grzx/merchanDisedetails/merchanDisedetails?id=" + info.href })
			}
		},
	}
};